package com.own.business.exam.entity.bo;


import com.own.business.exam.entity.po.ExamRuleQuestionCount;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * ExamRuleQuestionCountBo
 *
 * @author chenxueli
 * @date 2021/05/19 14:01:47
 */
@Schema(title = "考试规则题目类型数量表" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamRuleQuestionCountBo extends BaseBo<ExamRuleQuestionCount> {

    @Schema(title = "规则id")
    private Long ruleId;

    @Schema(title = "题目类型")
    private Integer type;

    @Schema(title = "数量")
    private Integer number;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public ExamRuleQuestionCount toPo(ExamRuleQuestionCount entity) {
        if (entity == null) {
            entity = new ExamRuleQuestionCount();
        }
        entity.setFkRuleId(ruleId);
        entity.setType(type);
        entity.setNumber(number);
        return super.toPo(entity);
    }

}
